<?php
/**
 * Base_App
 *
 * LICENSE
 *
 * This source file is subject to the new CC-GNU LGPL
 * It is available through the world-wide-web at this URL:
 * http://creativecommons.org/licenses/LGPL/2.1/
 *
 * @category   Base_App
 * @copyright  Copyright (c) 2009 Alexander fanatique* Thomas (me@alexander-thomas.net)
 * @license    http://creativecommons.org/licenses/LGPL/2.1/
 */
class Model_Row_User extends Base_App_Db_Table_Row_Validating 
{
	private $_validation_rules = array();
	private $_errors = array();
	private $_log;
	
	public function __construct(array $config = array()){
		$this->_log = Zend_Registry::get('log') ;
		parent::__construct ($config);
		$this->_setValidationRules();
	}
	
	/**
	 * Defines rules for validating a new or an updated object.
	 * on_create rules are validated on creation and on updating the object.
	 * on_update is skipped on creation.
	 */
	protected function _setValidationRules () {
		$this->_onCreateValidation('name', 'StringLength', true, array(1 ,100));
		$this->_onCreateAndUpdateValidation('email', 'EmailAddress', true);
		$this->_onCreateValidation('email', 'Unique', true, array('accounts', 'email'));
	}
}
?>
